<!doctype html>
<html>
<head>
    <title>推送管理</title>
    <link rel="stylesheet" href="/static/broder.css">    

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <style type="text/css">
        a{
            color: black; 
            text-decoration:none;
        }
        .box{
            width:100%;
            margin:0 auto;
            overflow:hidden;
        }
        .box .left{
            width:50%;
            min-width:400px;
            height:100%;
            /* background-color:#0f0; */
            float:left;
        }
        .box .right{
            width:50%;
            min-width:400px;
            height:100%;
            /* background-color:#f00; */
            float:left;
        }
    
    </style>
    <script>  
        function weiboConfirmDialog(uid){  
            if(confirm("确认删除？")){  
                window.location.href="deleteuser/"+uid
            }  
        }

        function twitterConfirmDialog(uid){  
            if(confirm("确认删除？")){  
                window.location.href="twitter/deleteuser/"+uid
            }  
        }
    </script> 
</head>

<div class="box">

   <div class="left">
        <h3>微博</h3>

        {% if at_all == "true" %}
            <a href="{{url_for('enable_at_all',enable='false')}}" target="view_window" >关闭@全部 </a>
        {% else %}
            <a href="{{url_for('enable_at_all',enable='true')}}" target="view_window" >打开@全部 </a>
        {% endif %}

        </br>
        </br>
        <form action="adduser">
            <input type="text" name="uid" value="" placeholder="输入对方 UID">
        <input type="submit" value="添加">
        </form>
        </br>
        <a href="{{url_for('view_log',type='crawler')}}" target="view_window" >查看爬虫日志</a>
        <a href="{{url_for('view_log',type='manager')}}" target="view_window" >查看后台日志</a>
        </br>
        </br>
        <table class="pure-table pure-table-bordered">
            <tr>
            <th>昵称</th>
            <th>uid</th>
            <th>操作</th>
            </tr>
            {% for user in uids %}
            <tr>
                <td> <a href="/user/{{user[0]}}" target="view_window" >{{user[1]}}</a></td>
        
                <td><a target="view_window" href="https://m.weibo.cn/api/container/getIndex?type=uid&value={{user[0]}}&containerid=107603{{user[0]}}&count=25">{{user[0]}}</a></td>
        
                <td><a  href="javascript:weiboConfirmDialog({{user[0]}})" >删除</a></td>
            </tr>
            {% endfor %}
        </table>
        

    </div>
    <div class="right">
        <h3>Twitter</h3>
        <form action="twitter/adduser">
            <input type="text" name="uid" value="" placeholder="输入对方 UID">
        <input type="submit" value="添加">
        </form>
        </br>
        <a href="{{url_for('view_log',type='twitter')}}" target="view_window" >查看爬虫日志</a>
        </br>
        </br>
        <table class="pure-table pure-table-bordered">
            <tr>
            <th>昵称</th>
            <th>uid</th>
            <th>操作</th>
            </tr>
            {% for user in twitter_user %}
            <tr>
                <td> <a href="https://twitter.com/{{user[0]}}" target="view_window" >{{user[1]}}</a></td>
        
                <td>{{user[0]}}</td>
        
                <td><a  href="javascript:twitterConfirmDialog('{{user[0]}}')" >删除</a></td>
            </tr>
            {% endfor %}
        </table>
        
    </div>
</div>  

</html>